package com.sxbang.bms.controller;

import com.alibaba.fastjson.JSONObject;
import com.sxbang.bms.base.result.Results;
import com.sxbang.bms.model.SysUser;
import com.sxbang.bms.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoignController {

    @Autowired
    public LoginService loginService;

    @ResponseBody
    @RequestMapping(value = "/login" ,method = RequestMethod.POST)
    public Results<JSONObject> Login(String username, String password) {
        return loginService.getUerByUsernameAndPassword(username, password);
    }
}
